package com.syni.mdd.yhd.common.all.service;

import com.syni.mdd.yhd.common.all.dao.jpa.BmsDxGroupBuyDao;
import com.syni.mdd.yhd.common.all.dto.requestDto.groupBuy.DxGroupBuyReDto;
import com.syni.mdd.yhd.common.all.dto.requestDto.groupBuy.GroupBuyUseReDto;
import com.syni.mdd.yhd.common.all.entity.BmsDxGroupBuy;
import com.syni.mdd.yhd.common.all.entity.record.ReGroupUseLog;
import com.syni.mdd.yhd.common.all.entity.record.ReTransferLog;
import com.syni.mdd.yhd.common.all.quartz.groupBuy.job.LimitGroupBuyTimingJob;
import com.syni.mdd.sjb.common.component.utils.common.utils.ParamsMap;

import java.util.*;

public interface BmsDxGroupBuyService {
    //扫码核销
    int verStatusInSweep = 1;
    //券码核销
    int verStatusInCode = 2;
    //美食模板
    int foodTemplateId = 1;
    //海报模板
    int trainingTemplateId = 2;
    //丽人模板
    int beautyTemplate = 3;
    //
    int bargainGroupBuyTemplate = 5;

    //普通团购
    int GROUP_TYPE_GEN = 0;
    //特特乐团购
    int GROUP_TYPE_TETE = 1;
    //砍价团购
    int GROUP_TYPE_BARGAIN = 2;
    //秒杀团购
    int GROUP_TYPE_SECONDS_KILL = 3;
    //海报团购
    int GROUP_TYPE_POSTERS = 4;

    //到期下线
    int TIME_END_OFFLINE = 2;
    //到期下线
    int SELL_END_OFFLINE = 3;

    Set<Integer> bargainGroupBuyTemplates = new HashSet<>(Arrays.asList(bargainGroupBuyTemplate));

    int FoodTemplate = 1;


    BmsDxGroupBuyDao getBaseDao();

    Map<String, Object> businessCreateGroupBuy(DxGroupBuyReDto dxGroupBuyReDto);

    Map<String, Object> businessFindGroupBuy(DxGroupBuyReDto dxGroupBuyReDto);

    Map<String, Object> businessUpdateGroupBuy(DxGroupBuyReDto dxGroupBuyReDto);

    Map<String, Object> businessUpdateGroupBuyStatus(DxGroupBuyReDto dxGroupBuyReDto);

    Map<String, Object> userGetBusinessGroupBuy(ParamsMap paramsMap) throws Exception;

    BmsDxGroupBuy getGroupBuyById(Integer groupBuyId);

    void postHandleBusiness(List<BmsDxGroupBuy> bmsDxGroupBuys);

    void postHandleGroupGif(List<BmsDxGroupBuy> bmsDxGroupBuys);

    void postHandleGroupContent(List<BmsDxGroupBuy> bmsDxGroupBuys,boolean isDisplayDelete);

    void postHandleGroupBuy(BmsDxGroupBuy bmsDxGroupBuy,boolean isDisplayDelete);

    Map<Integer,BmsDxGroupBuy> getGroupBuyById(Set groupBuyIds);

    Map<String, Object> businessUserVerGroupBuy(GroupBuyUseReDto groupBuyUseReDto);

    Map<String, Object> businessUserVerGroupBuy(ReGroupUseLog reGroupUseLog,ReTransferLog reTransferLog,GroupBuyUseReDto groupBuyUseReDto) throws Exception;

    Map<String, Object> businessUserVerGroupBuyByScan(GroupBuyUseReDto groupBuyUseReDto);

    Map<String, Object> businessDeleteGroupBuy(DxGroupBuyReDto dxGroupBuyReDto);

    boolean checkIsOpenGroupBuy(Integer businessId);

    Map<Integer,Integer> checkIsOpenGroupBuy(Set<Integer> businessIds);

    Map<String, Object> recordGroupBuyVisitNum(DxGroupBuyReDto dxGroupBuyReDto);

    Map<String, Object> getGroupBuyPreferential(ParamsMap paramsMap);

    Map<String, Object> getGroupBuyPreferential_V2(ParamsMap paramsMap);

    Map<String, Object> getGroupBuyPreferentialMore(ParamsMap paramsMap);

    Map<String, Object> getGroupBuyDetail(ParamsMap paramsMap);

    Map<String, Object> getGroupBuyMore(ParamsMap paramsMap);

    Map<String, Object> getLimitBuyGroupBuy(ParamsMap paramsMap);

    Map<String, Object> getLimitBuyGroupBuy_V2(ParamsMap paramsMap);

    Map<String, Object> getBusinessMoreGroupBuy(ParamsMap paramsMap);

    Map<String, Object> getAllGroupBuy(ParamsMap paramsMap);

    Map<String,Object> postLimitBuyLogic(Integer groupBuyId);

    void doGroupBuyTiming(Class classes,BmsDxGroupBuy bmsDxGroupBuy);

    Map<String, Object> businessUserVerGroupBuyByCode(GroupBuyUseReDto groupBuyUseReDto);

    Set<Integer> findGroupBuyByGroupName(String searchText);

    Set<Integer> findGroupBuyByVendorName(String searchText);

    Set<Integer> findGroupBuyByGroupOrVendorName(String searchText);

    void uploadBmsDxGroupBuy(Set<Integer> businessIds);

    Map<String, Object> getAllGroupBuy_v2(ParamsMap paramsMap);

    Map<Integer,Integer> countGroupBuyNumByBusinessIds(Set businessIds);

    Set<Integer> getGroupBuyByIndex(Integer index);

    void postHandleBusiness(BmsDxGroupBuy bmsDxGroupBuy);

    void postHandleGroupContent(BmsDxGroupBuy bmsDxGroupBuy);

    void postHandleShowTemplateId(BmsDxGroupBuy bmsDxGroupBuy);

    void postHandleGroupDetailImg(BmsDxGroupBuy bmsDxGroupBuy);

    Map<String, Object> getMerchantGroupBuyDetail(ParamsMap paramsMap);
}
